package com.zeyi.chat.manager;

import javafx.scene.layout.Pane;
import javafx.stage.Stage;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zeyi
 */
public class StageManager {
    private static Stage primaryStage;
    private static Stage friendStage;
    private static Stage groupStage;
    private static Map<String, Pane> nodeMap = new HashMap<>();

    public static Stage getPrimaryStage() {
        return primaryStage;
    }

    public static void setPrimaryStage(Stage stage) {
        StageManager.primaryStage = stage;
    }

    public static void addChat(String name, Pane node) {
        nodeMap.put(name, node);
    }

    public static Pane getChat(String name) {
        return nodeMap.get(name);
    }

    public static Pane removeChat(String name) {
        return nodeMap.remove(name);
    }

    public static Stage getFriendStage() {
        return friendStage;
    }

    public static void setFriendStage(Stage friendStage) {
        StageManager.friendStage = friendStage;
    }

    public static Stage getGroupStage() {
        return groupStage;
    }

    public static void setGroupStage(Stage groupStage) {
        StageManager.groupStage = groupStage;
    }
}
